-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
security: disable plugin in default and persist file in specified dir #7087
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Skipping CI for Draft Pull Request. |
Signed-off-by: husharp <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #7087 +/- ##
==========================================
+ Coverage 74.31% 74.33% +0.02%
==========================================
Files 440 440
Lines 47217 47202 -15
==========================================
Hits 35088 35088
+ Misses 9034 9015 -19
- Partials 3095 3099 +4
Flags with carried forward coverage won't be shown. Click here to find out more. |
pkg/schedule/config/config.go
Outdated
@@ -57,6 +57,7 @@ const ( | |||
defaultEnablePlacementRules = true | |||
defaultEnableWitness = false | |||
defaultHaltScheduling = false | |||
defaultEnableSchedulePlugin = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we need to add a release note about the default value changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added.
server/api/plugin.go
Outdated
@@ -48,6 +48,10 @@ func newPluginHandler(handler *server.Handler, rd *render.Render) *pluginHandler | |||
// @Failure 500 {string} string "PD server failed to proceed the request." | |||
// @Router /plugin [post] | |||
func (h *pluginHandler) LoadPlugin(w http.ResponseWriter, r *http.Request) { | |||
if !h.GetScheduleConfig().EnableSchedulePlugin { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to be a compile option
, and disable by default. otherwise, hackers may enable it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL! after make pd-server-plugin
:
curl -X POST 'http://127.0.0.1:2379/pd/api/v1/plugin'
load plugin is disabled, please `make pd-server-plugin` first%
curl -X DELETE 'http://127.0.0.1:2379/pd/api/v1/plugin'
unload plugin is disabled, please `make pd-server-plugin` first%
cc @lhy1024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about PLUGIN=1 make pd-server
, similiar to SWAGGER
and DASHBOARD
Signed-off-by: husharp <[email protected]>
/merge |
@nolouch: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 0859671
|
/hold |
/hold cancel |
@HuSharp: Your PR was out of date, I have automatically updated it for you. If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/hold |
/hold cancel |
In response to a cherrypick label: new pull request created to branch |
close tikv#7094 Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
close tikv#7094 Signed-off-by: ti-chi-bot <[email protected]>
…#7087) (#7141) close #7094 Signed-off-by: husharp <[email protected]> Co-authored-by: husharp <[email protected]> Co-authored-by: Hu# <[email protected]>
…#7087) (#7142) close #7094 Signed-off-by: husharp <[email protected]> Co-authored-by: husharp <[email protected]> Co-authored-by: Hu# <[email protected]> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
What problem does this PR solve?
Issue Number: Close #7094
What is changed and how does it work?
Check List
Tests
Release note